<template>
	<view class="box">
		
		<view class="search_box">

          <u-search bg-color="#fff" :show-action="false" placeholder="搜索合作商家" @search='to' v-model="params.name"></u-search>
		  
		</view>
		
		<view class="list_box">
			
			<view class="info_box clearfix" v-for="(item,index) in list" :key="index" @click="$project.toPath('/pages/dp/info?id='+item.id)">
				
				
				<view class="c_box name_box">
					<image class="img images" :src="item.image"></image>
					<view class="name_box " style="text-align: center; line-height: 2;">
						<view class="title" >{{item.name}}</view>
					  
					</view>
					<!-- 标签 -->
					<!-- <view class="num_box">
						<view class="num">{{item.jj}}</view>
					</view> -->
					<!-- 地址 -->
					<!-- <view class="site_box">
						<u-icon name="map-fill" class="site_box_icon"></u-icon>
						<view style="text-indent: 1.5em;" class="site_box_text">{{item.site}}</view>
					</view> -->
					
				</view>
				
				<!-- <view class="site_box flex ">
					<u-icon name="map-fill"></u-icon>
					<view>{{item.site}}</view>
				</view> -->
				
			</view>
			
		</view>
		
		<view class="bitmap" v-if="emptyShow">
			<image src="../../static/img/no_content.png" mode="aspectFit"></image>
			<view class="gray_font fs-13">
				暂无
			</view>
		</view>
		
		
	</view>
</template>

<script>
	
	export default{
		data(){
			return{
				keyword:'',
				cate:[],
				current:0,
				params:{page:1,limit:10,name:''},
				list:[],
				total:0,
				emptyShow:false
				
			}
		},
		onShow() {
			
		},
		onLoad() {
		this.getList();
		   	
		},
		methods:{
			
			to(){
				this.getList();
			},
			getList() {
				this.params.page = 1;
				this.$get(this.$api.dplist, this.params, res => {
					console.log(res)
					let data = res.data;
			
					if (!data.data.data || data.data.data.length < 1) {
						this.emptyShow = true;
					} else {
						this.emptyShow = false;
					}
			
					this.list = data.data.data;
					this.total = data.data.total;
				});
			}
		},
		onReachBottom() {
			if (this.list.length < this.total) {
				this.params.page++;
				this.$get(this.$api.dplist, this.params, res => {
					let data = res.data;
					console.log(res)
					data.data.data.forEach(ress => {
						this.list.push(ress);
					});
				});
			}
		},
	}
</script>

<style lang="scss" scoped>
	/deep/ .u-tab-item{
		background-color: transparent !important;
		font-size: 28rpx !important;
	}
	.box{
		min-height: 100vh;
		background-color: #F6F6F6;
		box-sizing: border-box;
		padding: 0 20rpx;
	}
	.search_box{
		
		box-sizing: border-box;
		padding: 30rpx 0 0 0;
	}
	.tab_box{
		margin-top: 20rpx;
	}
	.list_box{
		box-sizing: border-box;
		padding: 30rpx 0rpx;
	}
	.info_box{
		border-radius: 15rpx;
		background-color: white;
		margin-bottom: 20rpx;
		box-sizing: border-box;
		padding: 20rpx;
		// display: flex;
		
	}
	.img{
		min-width:320rpx;
		margin-right: 40rpx;
		border-radius: 15rpx;
		float: left;
	}
	.images{
		width: 100%;
		
	}
	.name_box{
		// float: left;
	}
	.c_box{
		
	}
	.flex{
		display: flex;
		align-items: center;
	}
	.title{
		font-size: 34rpx;
	}
	.num_box{
		font-size: 28rpx;
		margin-top: 15rpx;
		float: left;
	}
	.num{
		font-size: 24rpx;
		color: #A1A1A1;
	}
	.site_box_icon{
		position: absolute;
		margin-top: 5rpx;
	}
	.site_box_text{
		position: relative;
	}
	.level{
		border: 1rpx solid #EF8200;
		color: #EF8200;
		box-sizing: border-box;
		padding: 1rpx 10rpx;
		border-radius: 15rpx;
		font-size: 24rpx;
		margin-left: 20rpx;
	}
	.b_box{
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 26rpx;
		color: #978E8C;
	}
	.label_box{
		display: flex;
		align-items: center;
		flex-wrap: wrap;
	}
	.label{
		font-size: 24rpx;
		margin: 15rpx 10rpx 0 0;
		background-color:#F7ECE4;
		color:#EF8200;
		box-sizing: border-box;
		padding: 6rpx 20rpx;
		border-radius: 10rpx;
	}
	.site_box{
		margin-top: 15rpx;
		font-size: 26rpx;
		display: inline-block;
	}
	.bitmap {
		margin-top: 10vh;
		text-align: center;
	}
</style>